﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using KTX.Public;

namespace KTX.Data
{
   public class BienBanXLData
    {
        ClsKetNoi cls = new ClsKetNoi();
        public DataTable LoadBienbanXL()
        {
            return cls.LayDuLieu("select * from bienban_xuly");
        }
        public DataTable TimBBTheoMa(BienBanXLPublic p)
        {
            int NParameter = 1;
            string[] name = new string[NParameter];
            object[] value = new object[NParameter];
            name[0] = "@SO_BB";
            value[0] = p.BBXLSo;
            return cls.LayDuLieu("select * from bienban_xuly where so_bb = @SO_BB", name, value, NParameter);
        }
        public int Xoa(BienBanXLPublic p)
        {
            int NParameter = 1;
            string[] name = new string[NParameter];
            object[] value = new object[NParameter];
            name[0] = "@SO_BB";
            value[0] = p.BBXLSo;
            return cls.Update("delete from bienban_xuly where so_bb = @@SO_BB", name, value, NParameter);
        }
           
    }
}
